package pers.vic.dubbo.consumer.api;

import org.apache.dubbo.config.annotation.DubboService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pers.vic.dubbo.common.api.Provider2Interface;
import pers.vic.dubbo.common.tool.DubboTools;

/**
 * 描述:
 * @author Vic.xu
 * @date 2022-01-04 11:49
 */
@DubboService(version = "2.0.0")
public class CanProviderService implements Provider2Interface {
    private Logger logger = LoggerFactory.getLogger(CanProviderService.class);

    @Override
    public int justAdd(int num, int added) {
        printTranceId();
        return num + added;
    }


    private void printTranceId(){
        logger.info(" TanceId:" + DubboTools.getLocalTranceId());
    }

}
